package com.martin.dms.web.services;

import java.util.List;

import com.martin.dms.web.beans.CategoryBean;
import com.martin.dms.web.beans.ItemBean;

/**
 * Service used to control the Category web flow.
 * 
 * @author mtsvetkov
 */
public interface CategoryFlowService {

    /**
     * Retrieves all categories and places them in <code>CategoryBean</code>s.
     * 
     * @return a list with all categories.
     */
    public List<CategoryBean> getAllCategories();

    /**
     * Retrieves a category and places it in a <code>CategoryBean</code>.
     * 
     * @param id - id of the category.
     * @param copyItems - if true the <code>CategoryBean</code> will be filled with the information
     *            of the items that are in the retrieved category.
     * @return a <code>CategoryBean</code>.
     */
    public CategoryBean getCategory(long id, boolean copyItems);

    /**
     * Deletes the <code>category</code>.
     * 
     * @param category to delete.
     */
    public void deleteCategory(CategoryBean category);

    /**
     * Saves the <code>category</code>.
     * 
     * @param category to save.
     */
    public void saveCategory(CategoryBean category);

    /**
     * Retrieves all items that has no category assigned.
     * 
     * @return list of <code>ItemBean</code>s.
     */
    public List<ItemBean> getAvailableItems();
}
